Repository navigation
fix(platform): reserve a quarter of the Ps for the default loop count (refs #756) - #1306
Draft
FumingPower3925 wants to merge 1 commit into
Draft
FumingPower3925 wants to merge 1 commit into
FumingPower3925 wants to merge 1 commit into
Conversation
…fault loop count (refs #756) The default loop count (Config.Workers not set, a host of alike CPUs) was n - max(1, n/8): 14 of 16. A cluster comparison on one amd64 host (WebSocket large-echo p99 against the std engine, 5 repetitions per arm, the rated levels 0.5 and 0.75 of saturation) found that the Ps left free decide the tail: 14 loops on 16 Ps read 3.26 and 8.75 times, 12 loops 1.45 and 3.37 times (MEASURED, lane-finding, not closing). The reserve is n - max(1, n/4), none for n <= 2: 12 of 16, 6 of 8, 3 of 4. A Workers set by the user is unchanged and so is the big.LITTLE plan. Updates the defaultLoopReserve comment, the Config.Workers and Resources docs, the README and the pinned figures in the tests. Not to be merged before the A/B with an A/A twin shows no small-message throughput regression.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Nov 16, 2026
Draft
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #756.
What
The default loop count (
Config.Workersnot set, a host of alike CPUs) leaves a reserve of Ps to the goroutines that are not loops. The reserve wasmax(1, n/8)(14 loops of 16). This raises it tomax(1, n/4)(none for n <= 2): 12 of 16, 6 of 8, 3 of 4, 24 of 32. AWorkersset by the user and the big.LITTLE plan are unchanged.Files:
internal/platform/cpuplan_linux.go(the one return statement and its comment),config.goandinternal/resource/resource.go(docs),README.md, and the pinned figures in the tests.Why
Cluster comparison on one amd64 host (16 CPUs, WebSocket large-echo, p99 against the std-h1 control, 5 repetitions per arm). MEASURED, lane-finding, not closing, on celeris 8ef98b7 (levels are fractions of saturation):
The Ps left free decide the tail. The bar of #756 is a ratio of at most 3 (near-miss up to 3.5) at 0.25, 0.5 and 0.75: this change alone is at the near-miss at 0.75, so it does not claim to close #756.
Status: NOT TO BE MERGED YET
Draft. It must not merge until a RULE 74 A/B with an A/A twin shows no small-message throughput or tail regression (HTTP/1 sync and async, io_uring, adaptive) AND no regression in the driver cells: fewer default loops also lowers what scales with
NumWorkers()(the server-wideMaxConns, driver pools such as PostgreSQL at 4xNumWorkers(): 56 to 48 on 16 CPUs), so the A/B includes the pg and redis cells, and the closing runs on the final commit are done.Tests
gofmt clean on the changed files (
gofmt -l .also liststest/benchcmp_ws/bench_test.go, which this diff does not touch) and go vet clean; linux/arm64 and linux/amd64 builds;go test -raceofinternal/platformandinternal/resource; the fullinternal/engine/epollandinternal/adaptivepackages (docker, seccomp unconfined, memlock 8 MiB); the pinned-figure tests of the reserve pass.